/*
 * Package il.ac.biu.cs.grossmm.api.flow
 * File BaseConditionalConverter.java
 * 
 * This is a part of presence service framework API. 
 * See javadoc for more information.
 *  
 * Copyright (C) 2006 Grossmann Mark
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
package il.ac.biu.cs.grossmm.api.flow;

import il.ac.biu.cs.grossmm.api.data.NodeType;
import il.ac.biu.cs.grossmm.api.keys.KeyPattern;

/**
 * A base class to simplify implementation of <tt>ConditionalConverter</tt>
 * interface.
 * 
 * @see ConditionalConverter
 */
public abstract class ConditionalConverterBase<Nsrc, Ndst> extends
	ConverterBase<Nsrc, Ndst> implements ConditionalConverter<Nsrc, Ndst> {
	final KeyPattern srcPattern;

	final KeyPattern dstPattern;

	/**
	 * The constructor
	 * @param name name of the module
	 * @param srcType source node type
	 * @param dstType destination node type 
	 * @param priority priority of this converter in range (0.0, 1.0]
	 * @param srcPattern source key pattern
	 * @param dstPattern destination key pattern
	 */
	public ConditionalConverterBase(String name, NodeType<Nsrc> srcType,
		KeyPattern srcPattern, NodeType<Ndst> dstType, KeyPattern dstPattern,
		double priority)
	{
		super(name, srcType, dstType, priority);
		this.srcPattern = srcPattern;
		this.dstPattern = dstPattern;
	}

	public KeyPattern getSourcePattern()
	{
		return srcPattern;
	}
	
	
	public KeyPattern getDestinationPattern()
	{
		return dstPattern;
	}

}
